﻿CREATE proc sp_dmdv_sua
@MaDV char(10),
@TenDVNew nvarchar(200)
as
declare @dem as int
select @dem=count(*) from danhmuc_donvi where MaDV=@MaDV
if(@dem=0)
	begin
	select ErrCode=0
	end
else
	begin
	update danhmuc_donvi
	set TenDV=@TenDVnew where MaDV=@MaDV
	select ErrCode=1
	end